package com.csdj.s3project.controller;


import com.csdj.s3project.common.WebResult;
import com.csdj.s3project.entity.Winner;
import com.csdj.s3project.service.IWinnerService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zq
 * @since 2022-01-18
 */
@RestController
@RequestMapping("/winner")
public class WinnerController {
    private Logger log = LoggerFactory.getLogger("winnercontroller");
    @Resource
    private IWinnerService iWinnerService;

    @GetMapping("winnerinfo")
    public WebResult selectWinnerInfo(){
        List<Winner> winnerList = iWinnerService.selectWinners();
        if(winnerList == null){
            return new WebResult().putData("winner",null);
        }
        return new WebResult().putData("winner",winnerList);
    }

}
